package com.niit.drugsmanager.utils;
import com.niit.drugsmanager.entity.User;
import com.niit.drugsmanager.service.UserService;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

public class SessionUtils {
    public static String ifUserNull(User user, UserService userService){
        if(user == null)
            return "redirect:/api/user/login";
        if(userService.getUserById(user.getId()) == null)
            return "redirect:/api/user/login";
        return null;
    }
}
